package com.xyw.code.platform.common.entity.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Created by xuyiwei on 2019/8/13.
 */
public class LogConstant {
    /**
     * 角色数据范围枚举
     */
    @Getter
    @AllArgsConstructor
    public enum LogTypeEnum {
        OP_TYPE(1,"操作记录"),
        ERROR_TYPE(2,"异常记录"),
        LOGIN_TYPE(3,"登录记录"),
        ;

        private int type;
        private String description;

        public static LogConstant.LogTypeEnum valueOf(int type) {
            for(LogConstant.LogTypeEnum typeVar : LogConstant.LogTypeEnum.values()) {
                if(typeVar.getType() == type) {
                    return typeVar;
                }
            }
            return  OP_TYPE;
        }
    }
}
